package com.iot.common.enums;

public enum MqttMessageTypeEnum {
    ONLINE("online", "终端上下线"),
    CLIENT_STATISTICS("clientStatistics", "终端统计消息"),
    CLIENT_STATUS("clientStatus", "终端状态消息"),
    READ_CONFIG("readConfig", ""),
    SET_CONFIG("setConfig", ""),
    GET_CLIENT_CONFIG("readLogList", ""),
    READ_LOG_CONTENT("readLogContent", ""),
    BLUETOOTH("bluetooth", ""),
    WIFI("wifi", ""),
    WIFI_AP("wifiAp", ""),
    OFF_LINE_SMS_NOTIFY("offLineSmsNotify", ""),
    DEL_BROADCAST("delBroadcast", ""),
    SPEEK("speek", ""),
    BROADCAST("broadcast", ""),
    GET_ALL_IMAGE("getAllImage", ""),
    GET_ALL_VIDEO("getAllVideo", ""),
    RESET_APP("resetApp", ""),
    RESET_CONFIG("resetConfig", ""),
    START_VPN("startVpn", ""),
    STOP_VPN("stopVpn", ""),
    FETCH_MEMS("fetchMems", ""),
    SET_MEMS("setMems", ""),
    TERMINAL("terminal", ""),
    WRITE_CONFIG("writeConfig", ""),
    WRITE_LOG_CONTENT("writeLogContent", ""),
    WRITE_LOG_LIST("writeLogList", ""),
    TERMINAL_RESULT("terminalResult", ""),
    DEV_STATUS("devStatus", ""),
    SCREEN_SHOT("screenShot", ""),
    FETCH_ALL_LOG("fetchAllLog", ""),
    FETCH_ALL_VIDEO("fetchAllVideo", ""),
    GPS("gps", ""),
    ;

    private String value;
    private String desc;
    MqttMessageTypeEnum(String value, String desc){
        this.value = value;
        this.desc = desc;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static MqttMessageTypeEnum fromString(String value) {
        if (value != null) {
            for (MqttMessageTypeEnum b : MqttMessageTypeEnum.values()) {
                if (value.equalsIgnoreCase(b.value)) {
                    return b;
                }
            }
        }
        return null;
    }
}
